//
//  HHUserCenter.h
//  InternetHospital
//
//  Created by chun.chen on 2022/2/14.
//  Copyright © 2022 HC. All rights reserved.
//  用户中心

#import <Foundation/Foundation.h>
#import "HHUserService.h"
#import "HHUserIdentites.h"
#import "HHUserModel.h"

NS_ASSUME_NONNULL_BEGIN

@interface HHUserCenter : NSObject

/// 用户服务协议
@property (nonatomic, strong) id<HHUserServiceProtocol> userService;
/// 用户配置协议
@property (nonatomic, strong) NSObject<HHUserConfigProtocol> *userConfig;

///MARK: - 实例
/// 单例
+ (instancetype)shared;

/// 身份信息
+ (HHUserIdentites *)identites;

/// 用户信息
+ (HHUserModel *)user;

///MARK: - 配置
/// 初始化配置
- (void)init_setup;

/// 绑定监听
/// @param delegate 监听者
- (void)bind:(id<HHUserDelegate>)delegate;

/// 解绑监听
/// @param delegate 监听者
- (void)unbind:(id<HHUserDelegate>)delegate;


///MARK: - 用户信息

/// 刷新用户信息
/// @param completion completion description
- (void)doReloadUserData:(void(^ _Nullable)(BOOL success) )completion;
/// 登出
- (void)doLogout;
/// 最后一次登录的手机号
+ (NSString *)userLastLoginPhone;


/// 手机密码登录
/// @param phoneNum 手机号
/// @param pwd 密码
/// @param completion completion description
-(void)doLogin:(NSString *)phoneNum password:(NSString *)pwd completion:(void(^ _Nullable)(BOOL success) )completion;

/// 发送验证码
/// @param phoneNum 手机号
/// @param type 类型
/// @param completion completion description
- (void)sendSms:(NSString *)phoneNum actionType:(NSInteger)type completion:(void(^ _Nullable)(BOOL success) )completion;

/// 验证码登录
/// @param phoneNum 手机号
/// @param code 验证码
/// @param completion completion description
- (void)userLogin:(NSString *)phoneNum verifyCode:(NSString *)code completion:(void(^ _Nullable)(BOOL success) )completion;

@end

NS_ASSUME_NONNULL_END
